package com.zx.mes.hyl.singleton;

/**
 * 懒汉模式
 * 单线程下有效,多线程有潜在的风险
 *
 * @author 华云龙
 * @date 2018-9-3
 */
public class LazySingleton {

    private static LazySingleton instance;

    private LazySingleton(){}

    public static LazySingleton getInstance(){
        if (instance == null) {
            instance = new LazySingleton();
        }
        return instance;
    }
}
